<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@include file="../../common/includeBaseSet.jsp" %>
<%@include file="../../common/operation_forbid.jsp" %>
<%@include file="../../common/jsVersion.jsp"%>
<script type="text/javascript">
    var documentType=${documentType};
	var currentUserName='';
    var customerId = '${customerId}';
    var roomId = '${roomId}';
    var userId = '${userId}';
    var menu= '${menu}';
    var customerProjectId='${customerProjectId}';
 	var old_subscribeId = '${subscribeId}';
</script>
<!DOCTYPE html >
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>认购换房</title>
    <!-- neptune -->
    <%@include file="../../common/extInclude.jsp" %>
    <script type="text/javascript" src="${contextPath}/static/js/jquery/json2.js"></script> 
    <script type="text/javascript" src="${contextPath}/static/js/components/customerComponent.js?v=${jsVersion}"></script>
    <script type="text/javascript" src="${contextPath}/static/js/components/estateComponent.js?v=${jsVersion}"></script>
    <script type="text/javascript" src="${contextPath}/static/js/components/userComponent.js?v=${jsVersion}"></script>
    <script type="text/javascript" src="${contextPath}/static/js/marketing/abnorma/subscribeChangeRoom.js?v=${jsVersion}"></script>
    <script type="text/javascript" src="${contextPath}/static/js/components/fileComponent.js?v=${jsVersion}"></script>
</head>
<script type="text/javascript">
var userIdStore = null;
var addPanel=null;
Ext.onReady(function() {
    Ext.Ajax.timeout = 180000; 
    Ext.define('Record', { 
        extend: 'Ext.data.Model',
        fields: ["relationAgentid","proportionCommission"]
    }); 
	userIdStore = new Ext.data.Store({
    	        fields: ["userName", "id"],
    	        proxy:{
    	            type:'ajax',
    	            url:contextPath+'/customer/customer/userByProjectIdForGroup',
    	            reader:{
                        type: 'json', 
                        root: 'root'  //数据
                   }
    	        },
    			autoLoad:false
    });
	userIdStore.load();
	Ext.tip.QuickTipManager.init()
	addPanel=Ext.create("customer.subscribe.addPanel");
	if(customerId!="" && null!=customerId){
		findCustomer(customerId);
	}
});
function findCustomer(customerId){
	//初始化房间信息
 	 Ext.Ajax.request({
	    url: contextPath+'/customer/customer/customerDetail',
	    params: {
	    	id: customerId
	    },
	    method: 'POST',
	    success: function(response){
	        var text = Ext.decode(response.responseText);
	        if(text.res=="1"){
	        	 //初始化客户信息
	     		  addPanel.getComponent("customerPanel").getForm().setValues(text.obj);
	     		  var familyMemberGridStore=addPanel.getComponent("customerPanel").getComponent("familyMemberGridPanel").getStore();
	     		  var extraParams=familyMemberGridStore.getProxy().extraParams;
		 	      familyMemberGridStore.load();  

		 	          
		 	          
	        }
	    }
	});
}
</script>
<body>
</body>
</html>